      SUBROUTINE RDREQMT4(FILENAMES,MAXEXP,EXPNAME,LUERR,IERR)
C
C THIS ROUTINE IS PART OF THE TOSS REQUIREMENTS FILE READER PACKAGE. IT
C LOADS THE PACKAGE CALLER'S ARRAY, EXPNAME, FROM THE PACKAGE'S INTERNAL
C ARRAY, FILENAMES. CALLED BY THE PACKAGE DRIVER, RDREQMT, WHEN
C EXPNAME(1) = 'ALL'.
C
C***********************************************************************
C
C BY C PETRUZZO GSFC/742  1/86
C        MODIFIED....
C
C***********************************************************************
C
      INCLUDE 'RDREQMT.INC'
C
      CHARACTER*8 FILENAMES(MAXEXPMTS),EXPNAME(1)
      CHARACTER*3 I4CHAR,CHTEMP
C
      IERR = 0
C
C CHECK FOR TOO MANY NAMES ON THE FILE
C
      NUMNAMES=0
      DO I=1,MAXEXPMTS
        IF(FILENAMES(I).NE.' ') NUMNAMES = NUMNAMES + 1
        END DO
      IF(NUMNAMES.GT.MAXEXP) THEN
        IERR = 2
        CHTEMP = I4CHAR(MAXEXP,3,K1)
        IF(LUERR.GT.0) WRITE(LUERR,9901)
     *     'YOUR PGM WANTS ALL EXPMTS. ' // 
     *        'REQMTS FILE HAS MORE THAN YOUR PGM ALLOWS(' //
     *        '= ' // CHTEMP(K1:3) // ')'
        GO TO 9999
        END IF
C
C LOAD THE EXPNAME ARRAY
C
      DO I=1,MAXEXP
        EXPNAME(I) = ' '
        END DO
      NEXP = 0
      DO IEXP=1,MAXEXPMTS
        IF(FILENAMES(IEXP).NE.' ') THEN
          NEXP = NEXP + 1
          EXPNAME(NEXP) = FILENAMES(IEXP)
          END IF
        END DO
C
 9999 CONTINUE
      RETURN
C
 9901 FORMAT(/,
     *   ' OBSERVATION REQUIREMENTS FILE READER. ERROR CONDITION.'/,
     *   (5X,A))    ! ERROR MESSAGE TEXT
      END
